#include "hstatus.h"

void Hstatus::setNstatus(QList<QString> vdata)

{
    data=vdata;
    status.clear();
    tableWidget->setRowCount(1);
    tableWidget->setColumnCount(data.size());
    for (int i=0;i<data.size();i++)
    {
        QString s;
        s.setNum(i);
        tableWidget->setItem(0,i,new QTableWidgetItem(data[i],QTableWidgetItem::Type));
        status.append(false);
    }


}
Hstatus::Hstatus(QTableWidget *vtableWidget)
{
    tableWidget=vtableWidget;
//    tableWidget->setColumnCount(1);
//    tableWidget->setRowCount(16);
//    for (int i=0;i<16;i++)
//    {
//        QString s;
//        s.setNum(i);
//        tableWidget->setItem(i,0,new QTableWidgetItem(s,QTableWidgetItem::Type));
//    }
}
void Hstatus::rowClick(int col)

{
    status[col]=!status[col];
    if (status[col])
    {
        tableWidget->setItem(0,col,new QTableWidgetItem("["+data[col]+"]",QTableWidgetItem::Type));
    }
    else
    {
        tableWidget->setItem(0,col,new QTableWidgetItem(data[col],QTableWidgetItem::Type));
    }
}
bool Hstatus::getStatus(int col)
{
    return status[col];
}
